[6.x] Fix incorrect update badges in the Control Panel updater#14890
Conversation
…ketplace latest The update check treated "not exactly equal to the marketplace's latest" as "an update is available", rather than "the installed version is older than the latest". This surfaced an "Update available" badge whenever a local install was ahead of the marketplace's indexed version (e.g. in the window between a release landing on Packagist and the marketplace indexing it). - Addon::isLatestVersion() now uses `>=` instead of strict equality, so an install equal to or newer than the marketplace latest is up to date. - The per-product updater badge derives "up to date" from the changelog's release types (no `upgrade` releases) instead of a string comparison, matching the server's classification and the count badge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Experiencing this also on 6.24.1. Same story on my end with three Alt Design addons that are each one release ahead of the marketplace's latest_version (alt-inbound 2.0.1 vs 2.0.0, alt-redirect 1.8.0 vs 1.7.0, alt-seo 1.4.2 vs 1.4.1). Result: a stuck "3" on the Updates badge while the Updates page happily says everything's up to date. Your fix sorts it. |
|
Thanks for the PR! The underlying issue should now be fixed on the Marketplace side — see my comment here: #10277 (comment). I've leave it to @jasonvarga to decide whether it's still worth merging this as an extra safeguard. |
|
Thanks, @duncanmcclean! This might also be useful if and when future beta versions of Statamic (or addons) are installed, but the CMS shows there are "updates". Since you're not on the same version as what's in the Marketplace you might still see those badges notifying you to make an update. |
The "Up to date" and "Security update available" header badges were derived from the current changelog page. Paginating past page 1 (which holds the newest, upgrade-typed releases) left only older releases, so both badges dropped incorrectly. Return onLatestVersion and securityUpdateAvailable from the changelog endpoint, computed across the full release set, and bind them directly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks for this! I pushed a couple of changes on top:
I updated the PR title and description to reflect it. By the way, Duncan's .com changes have hopefully addressed your initial problem, but if not, this PR is a nice defense in depth anyway. |
Fixes two cases where the updater showed the wrong badge:
Installed version newer than the marketplace (e.g. installed
7.12.1, marketplace still indexes7.12.0) showed a false "Update available".Addon::isLatestVersion()now treats equal-or-newer as up to date.Paginating the changelog flipped the header badge ("Update available" → "Up to date", or "Security update available" → "Update available"), because it was derived from the current page. The badges are now computed server-side across all releases and returned from the changelog endpoint.
Related: